< previous page page_388 next page >

Page 388
You can rewrite these two equations using the following trigonometric identities.
e10a6a0a59f035e870d90cca05b85fce.gif
Cos(f + q) = Cos(f) * Cos(q) - Sin(f) * Sin(q)
Sin(
f + q) = Cos(f) * Sin(q) + Sin(f) * Cos(q)
Making these substitutions you get:
e10a6a0a59f035e870d90cca05b85fce.gif
x2 = R * Cos(f) * Cos(q) - R * Sin(f) * Sin(q)
y
2 = R * Cos(f) * Sin(q) + R * Sin(f) * Cos(q)
Now substituting the values x1 = R * Cos(f) and y1 = R * Sin(f) into these equations gives the equations for rotation.
e10a6a0a59f035e870d90cca05b85fce.gif
x2 = x1 * Cos(q) - y1 * Sin(q)
y
2 = x1 * Sin(q) + y1 * Cos(q)
Combining Transformations
The equations for translation, scaling, and rotation use very different operations. To translate a point, you add values to the point's coordinates. To scale a point, you multiply its coordinates by scale factors. To rotate a point, you must use more complicated equations involving both of the point's coordinates in addition to sines and cosines.
Before you can easily combine these simple operations to form more complex transformations, you must be able to treat the different simple transformations in a uniform or homogeneous way.
z0408-04.gif
Figure 12.13
The mathematics of rotation.

 
< previous page page_388 next page >